<%@ page contentType="text/html;charset=UTF-8" %>
<% String path = request.getContextPath(); 
   String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<%@ include file="/WEB-INF/page/share/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>上传文件显示</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<script language="JavaScript">
//到指定的分页页面
function topage(page){
	var form = document.forms[0];
	form.page.value=page;
	form.submit();
}
function allselect(allobj,items) {
   if (null == items) {
      return;
   }
   var state = allobj.checked;
   if (items.length) {
      for(var i=0; i < items.length; i++) {
         if (!items[i].disabled) items[i].checked = state;
      }
   } else {
      if (!items.disabled) items.checked = state;
   }
}
function goEdit(type) {
	var form = document.forms[0];
	
	if (type == 'Comment') {
       form.action = '/cms/house/comment.do?houseId=${uploadFileForm.objId}&type='+type;
   	   form.method.value = 'list';
    }else if (type == 'house'){
    	
    	form.action = '/cms/uploadFile.do?method=listH&objType=house&objId=${uploadFileForm.objId}';
    	form.method.value = 'list';
    }else {
    	<c:if test="${uploadFileForm.objType eq 'house'}">form.action = "/cms/house.do?houseId=${uploadFileForm.objId}&type="+type;</c:if>
    	<c:if test="${uploadFileForm.objType eq 'building'}">form.action = "/cms/house/building.do?buildingId=${uploadFileForm.objId}&type="+type;</c:if>
    	form.method.value = 'editUI';
    }
	form.submit();
}
function deleteFiles(objform){
	objform.action = '<html:rewrite action="/cms/uploadFile/deleteV.do"/>';
	//objform.method.value = 'deleteV';
	objform.submit();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0">
<html:form action="/cms/uploadFile.do" method="post">
<html:hidden property="page"/>
<html:hidden property="objId"/>
<html:hidden property="objType"/>
<input name="method" type="hidden" value="list${uploadFileForm.objType eq 'house' ? 'H' : 'B'}">
  <table width="90%" border="0" cellspacing="1" cellpadding="2" align="center">
  	<c:if test="${uploadFileForm.objType eq 'house'}">
  	<tr bgcolor="#ffbe26">
    	<td colspan="4">
    		<table width="98%">
				<tr>
				<td>
					&nbsp;&nbsp;<a href="javascript:goEdit('Base');"><font color="#000000">房源信息</font></a>&nbsp;&nbsp;
					|&nbsp;&nbsp;<a href="javascript:goEdit('Trans');"><font color="#000000">交易信息</font></a>&nbsp;&nbsp;
					<!-- |&nbsp;&nbsp;<a href="javascript:goEdit('Audit');"><font color="#000000">审核信息</font></a>&nbsp;&nbsp; -->
					|&nbsp;&nbsp;<a href="javascript:goEdit('Comment');"><font color="#000000">评论列表</font></a>&nbsp;&nbsp;
					|&nbsp;&nbsp;<a href="javascript:goEdit('house');"><font color="#000000">图片列表</font></a>&nbsp;&nbsp;
					|&nbsp;&nbsp;<font color="#000000">视频列表</font>&nbsp;&nbsp;
				</td>
				</tr>
			</table>
    	</td>
    </tr>
  	</c:if>
    <tr><td colspan="4" bgcolor="#ffbe26" align="right">
    	<%@ include file="/WEB-INF/page/share/fenye.jsp" %>
	</td></tr>
    <tr>
      <td width="8%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">选择</font></div></td>
      <td width="10%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">代号</font></div></td>
      <td width="60%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">视频</font></div></td>
	  <td width="22%" nowrap bgcolor="#ffbe26"> <div align="center"><font color="#000000">上传时间</font></div></td>
    </tr>
<!---------------------------LOOP START------------------------------>
<c:forEach items="${pageView.records}" var="entry">
    <tr>
      <td bgcolor="f5f5f5"> <div align="center"><INPUT TYPE="checkbox" NAME="fileIds" value="${entry.fileId}"></div></td>
      <td bgcolor="f5f5f5"> <div align="center">${entry.fileId}</div></td>
      <td bgcolor="f5f5f5"> <div align="center"> <!-- <a href="<%=basePath %>sks/frontpages/district/districtVideo.jsp" target="_blank"> <%=basePath%>${entry.fullPathName} -->
      <embed src="<%=basePath %>${entry.fullPathName}" autoplay="false" autostart="false" width="270" height="200" align="middle" showcontrols="true" type="application/x-shockwave-flash"></embed>
      </div></td>
	  <td bgcolor="f5f5f5"> <div align="center">${entry.uploadTime}</div></td>
	</tr>
</c:forEach>
    <!----------------------LOOP END------------------------------->
    <tr>
      <td bgcolor="f5f5f5" colspan="4" align="center"><table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="10%"><INPUT TYPE="checkbox" NAME="all" onclick="javascript:allselect(this, this.form.fileIds)">全选</td>
            <td width="85%">
              <input type="button" class="frm_btn" onClick="javascript:deleteFiles(this.form)" value="删除 "> &nbsp;&nbsp;
              <input type="button" class="frm_btn" onClick="javascript:location.href='/cms/uploadFile.do?method=uploadVideoUI&objType=${uploadFileForm.objType}&objId=${uploadFileForm.objId}'" value="上传 "> &nbsp;&nbsp;
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
</html:form>
</body>
</html>